Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle hyphenation and large numbers ending in twelve for English ordinal words #281

Closed
wants to merge 1 commit into from

Conversation

Kalaina
Copy link
Contributor

@Kalaina Kalaina commented May 24, 2014

According to any grammatical reference I can find, ordinal numbers should be hyphenated in English following the same rules that cardinal numbers are. Additionally, I noticed that e.g. 112 was being ordinalized as "one hundred and ten second."

I opted to merge the code paths for these to avoid duplication of logic - in particular, respecting the rules for hyphenation of ordinals requires context about the rest of the number that wasn't available. Added a test for an ordinal ending in 12 and a cardinal multiple of ten.

I've also never used Git or Github before, so bear with me as I don't really know what I'm doing.

@MehdiK
Copy link
Member

MehdiK commented May 26, 2014

Thanks for the contribution @Kalaina.

This is an existing and well-established behavior in the framework and changing that could be a bit annoying to the users. I'm an ESLer and can't be sure about this to be honest. Could you please provide links for the grammatical references so we can make an educated decision about this? Thanks.

@Kalaina
Copy link
Contributor Author

Kalaina commented May 26, 2014

Sure! As far as I can recall, I haven't really ever encountered a case where a compound ordinal number isn't hyphenated in my life, which is why it struck me as being incorrect. Here are a few references about it:

"Whole numbers twenty-one through ninety-nine are hyphenated when they are written out, whether used alone or as part of a larger number, whether they are cardinal or ordinal, for example: twenty-one, twenty-first." - http://dictionary.reference.com/help/faq/language/g80.html

An example of "twenty-fifth" in a dictionary - http://www.merriam-webster.com/dictionary/twenty-fifth

An example of "twenty-first" in common use as per Wikipedia - http://en.wikipedia.org/wiki/Twenty-first_Amendment_to_the_United_States_Constitution

"If necessary to write out, hyphenate (both as noun and adjective) cardinal and ordinal numbers if
compound: e.g., twenty-one, twenty-first." - http://geology.wwu.edu/dept/resources/thesiswriting/AGU%20style_guide.pdf

"Hyphenate compound numbers from 21 to 99 (twenty-one), and compound cardinal and ordinal numbers when written out, as they are when starting a sentence (twenty-first, second-best)" - http://write-minded.com/hyphens.html

Additionally, Google searches for arbitrary specific terms of these such as "twenty first century" or "twenty ninth of march" have overwhelmingly hyphenated results, with those I could see that are not hyphenated falling to either brand names or inconsistencies (e.g. a page with a title that is not hyphenated and body text that is).

I can dig up some more if necessary.

@MehdiK
Copy link
Member

MehdiK commented May 27, 2014

Thanks for the correction and the links. I am sold :)

This is now merged. I also added an entry in the release-notes file (which was missing from your PR).

@MehdiK MehdiK closed this May 27, 2014
@MehdiK
Copy link
Member

MehdiK commented Jun 22, 2014

This is now released to NuGet as v1.27.0. Thanks for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants